﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using Medical_Store_Billing.Data_Access_Layer;
using Medical_Store_Billing.Object_Class;
using System.Windows.Forms;

namespace Medical_Store_Billing.Business_Login_Layer
{
    class KhachhangBLL
    {
        KhachhangDAL m_khachhangdal = new KhachhangDAL();
        Khachhangclass m_khachhangclass = new Khachhangclass();

        public DataTable Laydskhach()
        {
            return m_khachhangdal.Laydskhach();
        }
        public DataTable Lay()
        {
            return m_khachhangdal.lay();
        }
        public DataTable Timkh(String makh)
        {
            return m_khachhangdal.Timkh(makh);
        }
        public bool Themkh(string makh, string tenkh, string diachi, string sodt, int dothanthiet)
        {
            try
            {
                m_khachhangclass = new Khachhangclass();

                m_khachhangclass.Makh = makh;
                m_khachhangclass.Tenkh = tenkh;
                m_khachhangclass.Sodt = sodt;
                m_khachhangclass.Diachi = diachi;
                m_khachhangclass.Dothanthiet = dothanthiet;





                return m_khachhangdal.Themkh(m_khachhangclass);
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message);
                return false;
            }
        }
        public bool Suakh(string makh, string tenkh, string diachi, string sodt, int dothanthiet)
        {
            try
            {
                m_khachhangclass = new Khachhangclass();

                m_khachhangclass.Makh = makh;
                m_khachhangclass.Tenkh = tenkh;
                m_khachhangclass.Sodt = sodt;
                m_khachhangclass.Diachi = diachi;
                m_khachhangclass.Dothanthiet = dothanthiet;



                return m_khachhangdal.Suakh(m_khachhangclass);
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message);
                return false;
            }
        }


    }
}
